package com.xyd.test;

import com.xyd.service.PhoneBiz;
import com.xyd.service.PhoneBizImpl;
import com.xyd.service.PhoneBizProxyImpl;
import com.xyd.util.OutOfStockException;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Demo1 {
    ApplicationContext ac = new ClassPathXmlApplicationContext("spring.xml");


    @Test
    public void test1() throws OutOfStockException {
        PhoneBiz phoneBiz = (PhoneBiz) ac.getBean("phoneBiz");

        phoneBiz.buyPhone(200);
        phoneBiz.salPhone(100);

//        System.out.println(phoneBiz.getClass().getName());
    }

}
